package com.foreknow.service.impl;

import com.foreknow.dao.SettlecategoryMapper;
import com.foreknow.entity.Settlecategory;
import com.foreknow.service.SettlecategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@SuppressWarnings("ALL")
public class SettlecategoryServiceImpl implements SettlecategoryService {
    @Autowired
    private SettlecategoryMapper settlecategoryMapper;
    @Override
    public List<Settlecategory> findAll(String query) {
        return settlecategoryMapper.findSettlecategory(query);
    }

    @Override
    public boolean deleteById(Integer id) {
        return settlecategoryMapper.deleteByPrimaryKey(id)==1;
    }

    @Override
    public Integer deleteByIds(List<Integer> ids) {
        return settlecategoryMapper.deleteSettlecategorys(ids);
    }

    @Override
    public boolean insertInfo(Settlecategory settlecategory) {
        return settlecategoryMapper.insertSelective(settlecategory)==1;
    }

    @Override
    public boolean updateInfo(Settlecategory settlecategory) {
        return settlecategoryMapper.updateByPrimaryKeySelective(settlecategory)==1;
    }

    @Override
    public Settlecategory findById(Integer id) {
        return settlecategoryMapper.selectByPrimaryKey(id);
    }
}
